#include<iostream>
using namespace std;

#include<vector>

int maxProfit(vector<int>& prices, int fee) {
	int length1 = prices.size();
	vector<vector<int>>dp(length1, { 0,0 });
	dp[0][0] = -prices[0];
	for (int i = 1; i < length1; i++)
	{
		dp[i][0] = max(dp[i - 1][0], dp[i - 1][1] - prices[i]);
		dp[i][1] = max(dp[i - 1][1], dp[i - 1][0] + prices[i] - fee);
	}
	
	return dp[length1 - 1][1];
}


int main()
{
	return 0;
}